package com.htj.util;

import net.sf.json.JSONObject;

public class WeChatUser {
   public String GetUserid(String code) {
      String atoken = WeChatToken.get_accessToken();
      String url = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=" + atoken + "&code=" + code;
      JSONObject jsonObject = HttpUtil.httpsRequest(url, "GET", (String)null);
      return jsonObject.optString("UserId");
   }

   public JSONObject Getuserinfos(String userid) {
      try {
         String token = WeChatToken.get_accessToken();
         String url = "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=" + token + "&userid=" + userid;
         JSONObject jsonObject = HttpUtil.httpsRequest(url, "GET", (String)null);
         return jsonObject;
      } catch (Exception var5) {
         var5.printStackTrace();
         return JSONObject.fromObject("{\"errmsg\":\"errcode\"}");
      }
   }
}
